#include "aspect.h"
#include <string>
#include <stdio.h>
/**
 * g++ ATest.cpp -I./ -std=gnu++11
 *
 * g++ ATest.cpp AspectLogic.cpp -I./ -std=gnu++11
 *
 */
class HelloLogic {
public:
   void sayHello()
   {
	   std::string content;
	   content = "hello";
	   _A_POINT_(logic)(content);  
	   do{
			_A_POINT_(logic)(content); 
			_A_NEXT_(logic)(content);
			{
				_A_POINT_(logic)(content); 
				{
					_A_POINT_(logic)(content); 
				}
			}
			_A_NEXT_(logic)(content);
			do{
				int a = 111;
				int b = 112;
				_A_POINT_(logic_a)(b,a);  
				_A_NEXT_(logic_a)(b,a);
				_A_NEXT_(logic_a)(b);
			}while (false);
	   }while (false);
	   printf("HelloLogic::sayHello %s\n",content.c_str());
   }
   void sayHello1()
   {
	   std::string content;
	   content = "hello";
	   _A_POINT_(logic)(content);  
	   do{
			_A_POINT_(logic)(content); 
			_A_NEXT_(logic)(content);
			{
				_A_POINT_(logic)(content); 
				{
					_A_POINT_(logic)(content); 
				}
			}
			_A_NEXT_(logic)(content);
			do{
				int a = 111;
				int b = 112;
				_A_POINT_(logic_a)(b,a);  
				_A_NEXT_(logic_a)(b,a);
				_A_NEXT_(logic_a)(b);
			}while (false);
	   }while (false);
	   printf("HelloLogic::sayHello1 %s\n",content.c_str());
   }
};
template<typename T>
class CC{
public:
	static const char* getName()
	{
		return __PRETTY_FUNCTION__;
	}
	static std::string getClassname()
	{
		return typeid(CC).name();
	}
};
 
int main()
{
	printf("%s %s %s\n",CC<int>::getName(),CC<int>::getClassname().c_str(),CC<float>::getClassname().c_str());
	int a = 11;
	int b = 12;
	ASPECT_POINT(a_b)(a,b);  
	do
	{
		ASPECT_CHILD(a_b,a_b_child)();  
	}while (false);
	ASPECT_NEXT(a_b,assert_a_b)(a,b);
	HelloLogic hLogic;
	hLogic.sayHello();
	hLogic.sayHello1();
	return 0;
}
